home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
cpp_libs
/
oath.lha
/
oath
/
test
/
gctest.cc
< prev
next >
Wrap
C/C++ Source or Header
|
1991-08-29
|
821b
|
31 lines
#include "oath/oath.h"
#include "timer.h"
#include <iostream.h>
// Run the following program and monitor from OS.
// It should eat up a lot of memory immediately, then
// eat no more from then on. If it continues to grow
// then there is a memory leak!
#define TOKEN_COUNT 100000
main ()
{cout << "Beginning test. Press c-C to stop." << endl;
timer Timer;
while(1) // loop endlessly, creating and destroying objs
{Timer.split();
cout << Timer.real() << " : constructing "
<< TOKEN_COUNT << " tokens. Press c-C to stop." << endl;
listA L = dlListA::make();
for(int I = 0; I < TOKEN_COUNT; ++I)
L << localTokenA::make();
Timer.split();
cout << Timer.real() << " : constructed "
<< TOKEN_COUNT << " tokens. Press c-C to stop." << endl;
}
}